// map.js
import { statusMap } from "../../../utils/repairStatusMap";
Page({
  data: {
    // 30.25727 120.20523
    // 30.306196 120.35653
    latitude: 30.306196,
    longitude: 120.35653,
    statusMap,
    markers: [
      {
        id: 1,
        latitude: 30.306196,
        longitude: 120.35653,
        iconPath: "/static/images/marker.png",
        width: 40,
        height: 40,
      },
      {
        id: 2,
        latitude: 40.225857999999995,
        longitude: 116.23246699999999,
        // iconPath: "/static/images/marker.png",
        width: 40,
        height: 40,
      },
    ],
    repairDetail: {}, // 存储维修信息
  },
  onLoad({ id }) {
    this.getDetail(id);
  },
  async getDetail(id) {
    const { code, data } = await wx.http.get("/repair/" + id);
    if (code !== 10000) return wx.utils.toast();
    this.setData({
      repairDetail: data,
    });
  },
});
